package com.mitaotao._1_语法._3_分支._3_if判断;

import java.util.Scanner;

public class _10_是否闰年 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入需要判断的年份：");
        int year = scanner.nextInt();
        //能被4整除且不能被100整除，能被400整除的为闰年
        if (year>999 && year<9999){
            if (year%4==0 && year/100 != 0 || year%400==0){
                System.out.println(year+"年是闰年");
            }else {
                System.out.println(year+"年不是闰年");
            }
        }else {
            System.out.println("您输入的年份无效");
        }
        scanner.close();
    }
}
